#include "../src/StringRegex.hpp"
#include <iostream>

StringRegex regEng;

void Handle_Result(std::smatch mat)
{
  std::cout<<"Regex Success "<<mat[0]<<std::endl;
}

void WorkTest(std::string str,bool res)
{
  if(regEng.HandleString(str)==res)
    std::cout<<"测试通过 "<<str<<std::endl;
  else
    std::cout<<"测试失败 "<<str<<std::endl;
}

int main()
{
  regEng.append(R"(Record Start ([\w\/]+))",Handle_Result);
  regEng.append(R"(Record Stop)",Handle_Result);
  regEng.append(R"(Monitor Start)",Handle_Result);
  regEng.append(R"(Monitor Stop)",Handle_Result);

  WorkTest("Record Start /test/test.file",false);
  WorkTest("Record Start /test/test",true);
  WorkTest("Monitor Start",true);
  WorkTest("Monitor Start /test",false);
  WorkTest("Monitor Start ",false);
  WorkTest("Monitor Start\n",false);
}
